<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>中国传媒大学设备预约平台</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="{$projectUrl}/css/admin_style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="{$projectUrl}/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/jquery.cycle.all.min.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/globalJsFunction.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/calendar/calendar.js"></script>
<script type="text/javascript" src="{$projectUrl}/js/calendar/WdatePicker.js"></script>
<script type="text/javascript">
{literal}
$(document).ready(function(){
    $('#slideshow').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 3000,
        pager:  '#slider_nav',
        pagerAnchorBuilder: function(idx, slide) {
            // return sel string for existing anchor
            return '#slider_nav li:eq(' + (idx) + ') a';
        }
    });
});
{/literal}
</script>
</head>
<body>
<div class="main">
  <div class="main_resize">
    <div class="main_left">
      {include file=include/headerLogo.html}
      <div class="clr"></div>
      {include file=include/adminLeftMenu.html}
      <div class="clr"></div>
      <h2>&nbsp;</h2><!--
      <h2>Our News</h2>
      <p><span>12 Dec 2015 | 0 comments</span><br />
        <strong>Duis nec porttitor lorem</strong><br />
        Mauris et nisi urna nonfaucibus magna. Integer lacus ante then ullamcorper ut vulputate..</p>
      <p><span>14 Dec 2015 | 0 comments</span><br />
        <strong>Duis nec porttitor lorem</strong><br />
        Mauris et nisi urna nonfaucibus magna. Integer lacus ante then ullamcorper ut vulputate..</p>
      <h2>&nbsp;</h2>
      <h2>What They Say</h2>
      <p>&quot;Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse voluptas nulla pariatur?&quot;</p>
      <p><em><strong>by: John S., webdesigner</strong></em></p>-->
    </div>
    <div class="main_right">
      {include file=include/headerLogin.html}

      <div class="clr" style="background-color:#C63; height:1px;">&nbsp;</div>
      <div>
      {include file=include/adminTopMenu.html}
      </div>
      <div class="clr">
      </div>

      <!-- 搜索用户并且进行修改 -->
      <div class="clr">
       <!--全部用户的列表-->
                <div>
                	<p>
					        所有结果:{$ordersNumber}<br/>
					        <span>{if $searchNote eq ""}输入设备名字，设备编号，用户名，用户编号进行搜索
                		{else}{$searchNote}
                		{/if}
                		</span>
                		<span style="float:right">
					        <form id="form1" name="form1" method="get" action="order.php"><p><span style="font-size:12px">
					        	 <input type="hidden" name="action" id="action" value="search"/>
                        关键词<input type="text" class="keywords" id="keyword" name="keyword" maxlength="50" size="10" value="{$keyword}"/>
                    		开始时间<input class="Wdate" type="text" id="beginDate" name="beginDate" onClick="WdatePicker()" size="12" value="{$beginDate}"/>
                    		结束时间<input class="Wdate" type="text" id="endDate" name="endDate" onClick="WdatePicker()" size="12" value="{$endDate}"/>
                    		审核
                    		<select id="type" name="type">
                    				<option value="-1"{if $type eq "-1" || $type eq ""} selected="selected"{/if}>全部</option>
	                        <option value="0" {if $type eq "0"} selected="selected"{/if}>待审核</option>
	                        <option value="1"{if $type eq "1"} selected="selected"{/if}>审核通过</option>
	                        <option value="2"{if $type eq "2"} selected="selected"{/if}>审核拒绝</option>
	                      </select>
                    	<input name="b" type="submit" class="button" value="搜索" /></span></p>
					        </form>
					        </span></p>
               
                <input type="hidden" name="action" id="action" value="deleteorder"/>
                    <table width="100%" bgcolor="#FFFFFF" style="font-size:14px;">
                    <tr valign="top"  style="background-color:#C60">
                    		<td>图片</td>
                        <td>设备</td>
                        <td>编号</td>
                        <td>开始时间</td>
                        <td>结束时间</td>
                        <td>课程</td>
                        <td>用户名</td>
                        <td>用户编号</td>
                        <td>提交时间</td>
                        <td>状态</td>
                    </tr>
                    {foreach from=$orders item=order name=orderlist}
                    <tr valign="top"  onmouseout="this.style.backgroundColor=''"onmouseover="this.style.backgroundColor='#AAAAAA'">
                    		<td><a href="{$projectUrl}/showpictures/showpictures.php?did={$order.did}" target="_blank">
                    			<img src="{$order.picture}" width="25" height="20" /></a>
                    			</td>
                    		<td>{$order.dname}</td>
                    		<td>{$order.barcode}</td>
                    		<td>{$order.start_date}</td>
                    		<td>{$order.end_date}</td>
                    		<td>{$order.cname}</td>
                    		<td>{$order.uname}</td>
                    		<td>{$order.uid}</td>
                    		<td>{$order.createdate}</td>
                        <td>{if $order.pass eq 0}
                        		<a href="order.php?action=pass&lastAction={$action}&id={$order.id}&pageIndex={$pageIndex}&keyword={$keyword}&beginDate={$beginDate}&endDate={$endDate}&type={$type}">
                        			<img src="{$projectUrl}/images/correct.jpg" width="20px" height="20px"/></a>
                        		<a href="order.php?action=reject&lastAction={$action}&id={$order.id}&pageIndex={$pageIndex}&keyword={$keyword}&beginDate={$beginDate}&endDate={$endDate}&type={$type}">
                        			<img src="{$projectUrl}/images/reject.jpg" width="20px" height="20px"/>
                        			</a>
                        	{elseif  $order.pass eq 1}
                        		<img src="{$projectUrl}/images/correct.jpg" width="20px" height="20px"/>
                        		{if $order.checkout eq 0}
                        		<a href="order.php?action=checkout&lastAction={$action}&id={$order.id}&pageIndex={$pageIndex}&keyword={$keyword}&beginDate={$beginDate}&endDate={$endDate}&type={$type}">点击借出</a>
                        		{elseif $order.checkin eq 0}
                        		<a href="order.php?action=checkin&lastAction={$action}&id={$order.id}&pageIndex={$pageIndex}&keyword={$keyword}&beginDate={$beginDate}&endDate={$endDate}&type={$type}">点击归还</a>
                        		{else}
                        		预约完成
                        		{/if}
                        	{elseif  $order.pass eq 2}<img src="{$projectUrl}/images/reject.jpg" width="20px" height="20px"/>
                        	{else}未知{/if}</td>
                    </tr>
                    {/foreach}


                   
                     <tr>
                    <td colspan="5" align="center">
                    <!-- 分页 -->
                        <a href="order.php?pageIndex={$leftPageIndex}">&lt;</a>

                    {section start=$leftMostPageIndex loop=$pageIndex step=1 name=pagesection}
                    <a href="order.php?pageIndex={$smarty.section.pagesection.index}">
                    {$smarty.section.pagesection.index}&nbsp;&nbsp;
                    </a>
                    {/section}
                    <span style="font-size:18px;"><Strong><bold>{$pageIndex}</bold></Strong>&nbsp;</span>
                    {section start=$pageIndex+1 loop=$rightMostPageIndex+1 step=1 name=rightpagesection}
                    <a href="order.php?pageIndex={$smarty.section.rightpagesection.index}">
                    {$smarty.section.rightpagesection.index}&nbsp;&nbsp;
                    </a>
                    {/section}

                    <a href="order.php?pageIndex={$rightPageIndex}">&gt;</a>
                    <!-- 分页 -->
                    </td>
                    </tr>
                    </table>
                </div>
                <!--全部用户的列表-->
      </div>
      <!-- 搜索用户并且进行修改 结束-->
      <div class="clr"></div>
      <!-- 编辑用户 -->
      {if $editUser.id neq ''}
      <div class="clr" id="editUserDiv">
      	<p><img src="{$projectUrl}/images/img_1.jpg" width="30px" height="30px"><span style="font-color:#C60; font-size:16px;">编辑用户</span></p>
                <div id = "modify_order" style="font-size:14px;">
                <form action="order.php?id={$editUser.id}&pageIndex={$pageIndex}#editUserDiv" method="post">
                <input type="hidden" name="action" id="action" value="modifyorder"/>
                <input type="hidden" name="orderid" id="orderid" value="{$editUser.id}"/>
                    <table bgcolor="#FFFFFF" width="100%" style="font-size:14px;">
                    	<tr>
                    		<td>编号</td><td>{$editUser.id}</td>
                    	</tr>
                    	<tr>
                    		<td>姓名</td><td><input type="text" id="name" name="name" size="14" value="{$editUser.name}"/></td>
                    		</tr>
                    	<tr>
                    		<td>预约次数</td><td><input type="text" id="booktime" name="booktime" size="10" value="{$editUser.booktime}"/></td>
                    		</tr>
                    	<tr>
                    		<td>类型</td>
                    		<td>
                    			<select id="type" name="type">
	                        <option value="0" {if $editUser.level eq 0}selected="selected"{/if}>学生</option>
	                        <option value="1" {if $editUser.level eq 1}selected="selected"{/if}>老师</option>
	                        </select>
                    		</td>
                    		</tr>
                    	<tr>
                    		<td>班级</td>
                    		<td>
                    			<select id="class" name="class">
                    				<option value="-1" {if $editUser.classid eq ""}selected="selected"{/if}></option>
	                        {foreach from=$classes item=class name=classlist}
	                        <option value="{$class.id}" {if $class.id eq $editUser.classid}selected="selected"{/if}>{$class.name}</option>
	                        {/foreach}
	                        </select>
                    		</td>
                    		</tr>
                    	<tr>
                    		<td>email:</td><td><input type="text" id="email" name="email" size="20" value="{$editUser.email}"/></td>
                    		</tr>
                    	<tr>
                    		<td>电话</td><td><input type="text" id="phone" name="phone" size="20" value="{$editUser.phone}" onkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"/></td>
                    		</tr>
                    	<tr valign="top">
                    		<td>介绍</td><td><textarea type="text" id="info" name="info" rows="2" cols="20">{$editUser.info}</textarea></td>
                    		</tr>
                    	<tr>
                    		<td>创建时间</td><td>{$editUser.createtime}</td>
                    	</tr>
                    <tr>
                    		<td>保存</td><td><input type="image" src="{$projectUrl}/images/save.jpg" class="button"/></td>
                    	</tr>
                    </table>
                </form>
                </div>
      </div>
      {/if}
      <!-- 编辑用户结束 -->


    </div>
    
    <!-- 展示用户的课程列表 -->
    <div class="clr">
    	
    </div>
  </div>
  <div class="footer">
    {include file=include/footer.html}
  </div>
</div>
<div align=center></div></body>
</html>
